With the development of the economy and the improvement of people's living standard, the number of times of traveling is increasing. During traveling, people will generally carry suitcases which are opened or closed by a slide fastener. Therefore, to coordinate with such suitcases, there are various coded locks in the market. However, at present, the opening or closing of a suitcase is controlled by two fastener pieces, that is, a slide fastener is provided with two fastener pieces. When the two fastener pieces are brought into contact with each other, the suitcase is closed. At this moment, two slide fastener pieces need to be secured onto the coded locks. As for the present coded locks one locking position corresponds to one fastener piece, two fastener pieces need to be snapped and then locked into two locking positions, respectively. Such a coded lock has great hazards in use: first, there is still a certain unclosed clearance between the two fastener pieces, making crimes possible, for example, throwing unknown objects or the like into the suitcase through this clearance; and second, once one of the two locking positions is damaged, loss may be brought to the user if he or she may think it still works well.